﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  >
  <Style x:Key="AssemblyBrowserViewTreeViewStyle" TargetType="{x:Type TreeView}">
    <Setter Property="Background" Value="White" />
    <Setter Property="ItemTemplate">
      <Setter.Value>
        <HierarchicalDataTemplate ItemsSource="{Binding Path=Types, Mode=OneWay}">
          
          <DockPanel>
            <Image DockPanel.Dock="Left" Source="{Binding Path=Icon}" Width="16" Height="16" Margin="-1,0,4,0" />
            <TextBlock Text="{Binding Path=DisplayName}" />
          </DockPanel>
          
          <HierarchicalDataTemplate.ItemTemplate>
            <DataTemplate>
              <DockPanel>
                <Image DockPanel.Dock="Left" Source="{Binding Path=Icon}" Width="16" Height="16" Margin="-1,0,4,0" />
                <TextBlock 
                  x:Name="txt" 
                  Text="{Binding Path=UnqualifiedName, Mode=OneTime}" 
                  ToolTip="{Binding Path=DisplayName, Mode=OneTime}" 
                  />
                <DockPanel.ContextMenu>
                  <ContextMenu>
                    <MenuItem Command="{Binding Path=OpenInReflectorCommand, Mode=OneTime}" Header="Open in Reflector">
                      <MenuItem.Icon>
                        <Image
                          Source="Images/Reflector.gif"
                          Width="16" Height="16"
                          />
                      </MenuItem.Icon>
                    </MenuItem>
                  </ContextMenu>
                </DockPanel.ContextMenu>
              </DockPanel>
              <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=IsSelected}" Value="True">
                  <Setter TargetName="txt" Property="FontWeight" Value="Bold" />
                </DataTrigger>
              </DataTemplate.Triggers>
            </DataTemplate>
          </HierarchicalDataTemplate.ItemTemplate>
        </HierarchicalDataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="ItemContainerStyle">
      <Setter.Value>
        <Style TargetType="{x:Type TreeViewItem}">
          <Setter Property="Background" Value="White" />
          <Setter Property="Foreground" Value="Black" />
          <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" />
          <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
          <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsRelevant}" Value="False">
              <Setter Property="Foreground" Value="LightGray" />
              <Setter Property="FontStyle" Value="Italic" />
            </DataTrigger>
          </Style.Triggers>
        </Style>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>